package org.example.blog_manage.config;

import lombok.extern.slf4j.Slf4j;
import org.example.blog_manage.model.Result;
import org.springframework.web.bind.annotation.ExceptionHandler;
import org.springframework.web.servlet.resource.NoResourceFoundException;


@Slf4j
public class ExceptionHandle {

    @ExceptionHandler
    public Result handle(Exception e){
        log.error("出现异常e:",e);
        return Result.Fail("内部错误，联系管理员");
    }

    public Result handle(NoResourceFoundException e){
        log.error("找不到路径e:{}",e.getResourcePath());
        return Result.Fail("文件路径异常");
    }


}
